# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ServiceUsage.V1.Model.EnableRule do
  @moduledoc """
  The consumer policy rule that defines usable services and service groups.

  ## Attributes

  *   `enableType` (*type:* `String.t`, *default:* `nil`) - Client and resource project enable type.
  *   `groups` (*type:* `list(String.t)`, *default:* `nil`) - DEPRECATED: Please use field `values`. Service group should have prefix `groups/`. The names of the service groups that are enabled (Not Implemented). Example: `groups/googleServices`.
  *   `services` (*type:* `list(String.t)`, *default:* `nil`) - DEPRECATED: Please use field `values`. Service should have prefix `services/`. The names of the services that are enabled. Example: `storage.googleapis.com`.
  *   `values` (*type:* `list(String.t)`, *default:* `nil`) - The names of the services or service groups that are enabled. Example: `services/storage.googleapis.com`, `groups/googleServices`, `groups/allServices`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enableType => String.t() | nil,
          :groups => list(String.t()) | nil,
          :services => list(String.t()) | nil,
          :values => list(String.t()) | nil
        }

  field(:enableType)
  field(:groups, type: :list)
  field(:services, type: :list)
  field(:values, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.ServiceUsage.V1.Model.EnableRule do
  def decode(value, options) do
    GoogleApi.ServiceUsage.V1.Model.EnableRule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ServiceUsage.V1.Model.EnableRule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
